<?php

namespace ElementVip\JwOms\Schedule;

use Carbon\Carbon;
use ElementVip\JwOms\Handler\GoodsHandle;
use ElementVip\JwOms\Handler\OrderHandle;
use ElementVip\JwOms\Handler\RefundHandle;
use ElementVip\JwOms\Handler\StockHandle;
use ElementVip\Scheduling\Schedule\Scheduling;

class OmsSchedule extends Scheduling
{
    public function __construct(\Illuminate\Console\Scheduling\Schedule $schedule)
    {
        parent::__construct($schedule);
    }

    public function schedule()
    {
        $this->schedule->command('oms:order')->everyFiveMinutes();
        $this->schedule->command('oms:refund')->everyFiveMinutes();
        $this->schedule->command('oms:stock')->everyFiveMinutes();
        $this->schedule->command('oms:goods')->dailyAt('3:10');
        /* $orderHandle = app('oms.order.handle');
         $refundHandle = app('oms.refund.handle');
         $stockHandle = app('oms.stock.handle');
         $goodsHandle = app('oms.goods.handle');*/


        /*if (!settings('ftp_enable')) return;


        $this->schedule->call(function () {

            \Log::info('ftp定时任务已进入1-oms');

            $orderHandle = app('oms.order.handle');
            $refundHandle = app('oms.refund.handle');
            $stockHandle = app('oms.stock.handle');
            $orderHandle->handle();
            $refundHandle->handle();
            $stockHandle->handle();

        })->everyFiveMinutes();

        $this->schedule->call(function () {

            \Log::info('ftp定时任务已进入2-oms');

            $goodsHandle = app('oms.goods.handle');
            $goodsHandle->handle();
        })->dailyAt('3:10');*/
    }
}